package com.rem.chat.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: Themberfue
 * @date: 2025/6/4 20:10
 * @description:
 */
@AllArgsConstructor
@Getter
public enum JoinTypeEnum {
    JOIN(0, "直接添加"),
    APPLY(1, "需要验证");

    private final Integer type;
    private final String desc;

    public static JoinTypeEnum getByType(Integer type) {
        try {
            for (JoinTypeEnum item: JoinTypeEnum.values()) {
                if (type.equals(item.getType())) {
                    return item;
                }
            }
            return null;
        } catch (Exception e) {
            return null;
        }
    }
}
